home *** CD-ROM | disk | FTP | other *** search
/ CD Actual Thematic 7: Programming / CDAT7.iso / demos / VisualAge for Java 2.0 Entry / setup / data1.cab / ide-e / IDE / cache / 1QJD4QP (.txt) < prev    next >
Encoding:
Java Class File  |  1998-09-16  |  1.1 KB  |  31 lines

  1. package sun.awt.image;
  2.  
  3. import java.io.BufferedInputStream;
  4. import java.io.ByteArrayInputStream;
  5. import java.io.InputStream;
  6.  
  7. public class ByteArrayImageSource extends InputStreamImageSource {
  8.    byte[] imagedata;
  9.    int imageoffset;
  10.    int imagelength;
  11.  
  12.    public ByteArrayImageSource(byte[] data) {
  13.       this(data, 0, data.length);
  14.    }
  15.  
  16.    public ByteArrayImageSource(byte[] data, int offset, int length) {
  17.       this.imagedata = data;
  18.       this.imageoffset = offset;
  19.       this.imagelength = length;
  20.    }
  21.  
  22.    final boolean checkSecurity(Object context, boolean quiet) {
  23.       return true;
  24.    }
  25.  
  26.    protected ImageDecoder getDecoder() {
  27.       InputStream is = new BufferedInputStream(new ByteArrayInputStream(this.imagedata, this.imageoffset, this.imagelength));
  28.       return ((InputStreamImageSource)this).getDecoder(is);
  29.    }
  30. }
  31.